<template>
	<view class="position-relative">
		<view class="oneadv-tit pt-2 pl-2 pb-1" v-if="title">{{title}}</view>
		<view :class="del?'oneadv-image':'oneadv-img'" v-if="cover">
			<image :src="cover" mode="" @click="clearHis"></image>
		</view>
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: "one-adv",
		data() {
			return {

			};
		},
		props:['title','cover','del'],
		methods:{
			clearHis(){
				this.$emit('clearHistory')
			}
		}
	}
</script>

<style scoped>
	.oneadv-tit{
		font-size: 32rpx;
		font-weight: 800;
	}
	.oneadv-img image{
		width: 100%;
		display: block;
	}
	.oneadv-image image{
		width: 32rpx;
		height: 40rpx;
		position: absolute;
		top: 24rpx;
		right: 20rpx;
	}
</style>